import random

class DiceSimulator:
    """ DiceSimulator
    
    Simulates rolls of dice.
    """
    
    def __init__(self, n_sides, n_dice):
        if n_sides<2:
            raise ValueError('n_sides should be greater than one')
        if n_dice<1:
            raise ValueError('n_dice should be greater than zero')
        self.n_sides, self.n_dice = n_sides, n_dice
    
    def Roll(self):
        """ Roll()
        
        Returns a tuple of two elements. First is a list of individual dice 
        rolls, second is the sum of rolls.
        """
        rolls = list()
        for roll in range(0, self.n_dice):
            rolls.append(random.randint(1, self.n_sides))
        return (rolls, sum(rolls))

if __name__=='__main__':
    # This code only executed if the file is run from the command line
    import sys
    if 3!=len(sys.argv):
        print(__doc__)
        sys.exit(1)
    else:
       result = DiceSimulator(int(sys.argv[1]), int(sys.argv[2])).Roll()
       print(result[0])
       print(result[1])
